const state = {
    // 商品详情
    goodsDetails: {},
    detailsCeilingShow: false,
    // 请求数据回来的判断
    ifResponse: false,
}
const mutations = {
    // 赋值
    GOODSDETAILS(state, data) {
        state.goodsDetails = {
            ...data,
            price: data.price.toLocaleString(),
            desc:data.desc.split("_")
        }
    },
    // 控制吸顶的显隐
    CHANGE(state, boolean) {
        state.detailsCeilingShow = boolean
    },
    // 数据回来的回调
    IFRESPONSE(state, boolean) {
        state.ifResponse = boolean
    }
}
const actions = {
    goodsDetails({commit}, data) {
        commit("GOODSDETAILS", data)
    },
    change({commit}, data) {
        commit("CHANGE", data)
    },
    ifResponseFn({commit}, data) {
        commit("IFRESPONSE", data)
    }
}
const getters = {
    
}

export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}